const express = require('express')
//2.实例化
const app = express()
//3.路由,路径匹配
app.get('/', (req, res) => {
    res.send('express启动http服务')
})
app.get('/data', (req, res) => {
    let data = {
        name: '张三',
        sex: '男',
        age: 23
    }
    res.send(data)
})
//监听视口
const port = 5000
app.listen(port, () => {
    console.log(`server is running at http://localhost:${port}`)
})